import request from '@/utils/request'

// 查询中介机构列表
export function listMediationBase(query) {
  return request({
    url: '/mediation/mediationBase/list',
    method: 'get',
    params: query
  })
}

// 查询中介机构详细
export function getMediationBase(id) {
  return request({
    url: '/mediation/mediationBase/' + id,
    method: 'get'
  })
}

// 保存中介机构
export function saveMediationBase(data) {
  return request({
    url: '/mediation/mediationBase/save',
    method: 'post',
    data: data
  })
}

// 删除中介机构
export function delMediationBase(id) {
  return request({
    url: '/mediation/mediationBase/' + id,
    method: 'delete'
  })
}

// 获取中介机构合作数据
export function getMediationChart(query) {
  return request({
    url: '/mediation/mediationBase/getMediationChart',
    method: 'get',
    params: query
  })
}

// 导出中介机构
export function exportMediationBase(query) {
  return request({
    url: '/mediation/mediationBase/export',
    method: 'get',
    params: query
  })
}

export function mediationDetailsByName(params) {
 return request({
   url: '/mediation/mediationBase/mediationDetailsByName',
   method: 'get',
   params: params
 })
}

// 根据中介机构类型查询
export function findByType(type) {
  return request({
    url: '/mediation/mediationBase/findByType/' + type,
    method: 'get'
  })
}

// 根据中介机构类型集合查询
export function findByTypeList(types) {
  return request({
    url: '/mediation/mediationBase/findByTypeList',
    method: 'post',
    data: types
  })
}

// 查询内部机构(仅ID和机构全称)
export function findMediation() {
  return request({
    url: '/mediation/mediationBase/findMediation',
    method: 'get'
  })
}

// 根据id查询中介机构
export function getByIdMainBody(id) {
  return request({
    url: '/mediation/mediationBase/getByIdMainBody/' + id,
    method: 'get'
  })
}

export function getMediationBaseByName(query) {
  return request({
    url: '/mediation/mediationBase/getMediationBaseByName',
    method: 'get',
    params: query
  })
}
